/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author stumbledog
 */
@Entity
@Table(name = "fantasyplayoff")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Fantasyplayoff.findAll", query = "SELECT f FROM Fantasyplayoff f"),
    @NamedQuery(name = "Fantasyplayoff.findByLeagueId", query = "SELECT f FROM Fantasyplayoff f WHERE f.leagueId = :leagueId"),
    @NamedQuery(name = "Fantasyplayoff.findByChampionship", query = "SELECT f FROM Fantasyplayoff f WHERE f.championship = :championship")})
public class Fantasyplayoff implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "leagueId")
    private Integer leagueId;
    @Column(name = "championship")
    private Integer championship;
    @JoinColumn(name = "leagueId", referencedColumnName = "id", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Fantasyleague fantasyleague;
    @JoinColumn(name = "fantasyMatchId", referencedColumnName = "id")
    @ManyToOne
    private Fantasymatch fantasyMatchId;

    public Fantasyplayoff() {
    }

    public Fantasyplayoff(Integer leagueId) {
        this.leagueId = leagueId;
    }

    public Integer getLeagueId() {
        return leagueId;
    }

    public void setLeagueId(Integer leagueId) {
        this.leagueId = leagueId;
    }

    public Integer getChampionship() {
        return championship;
    }

    public void setChampionship(Integer championship) {
        this.championship = championship;
    }

    public Fantasyleague getFantasyleague() {
        return fantasyleague;
    }

    public void setFantasyleague(Fantasyleague fantasyleague) {
        this.fantasyleague = fantasyleague;
    }

    public Fantasymatch getFantasyMatchId() {
        return fantasyMatchId;
    }

    public void setFantasyMatchId(Fantasymatch fantasyMatchId) {
        this.fantasyMatchId = fantasyMatchId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (leagueId != null ? leagueId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Fantasyplayoff)) {
            return false;
        }
        Fantasyplayoff other = (Fantasyplayoff) object;
        if ((this.leagueId == null && other.leagueId != null) || (this.leagueId != null && !this.leagueId.equals(other.leagueId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Fantasyplayoff[ leagueId=" + leagueId + " ]";
    }
    
}
